package 学生成绩;

public class Student  extends Person{

    int no;

    double score;

    double scoreEn;

    double scoreMa;

    double scoreCh;

    public double aver(){
        return (scoreEn+scoreMa+scoreCh)/3;
    }
    public double max(){
        return Math.max(Math.max(scoreCh,scoreEn),scoreMa);
    }
    public double min(){
        return Math.min(Math.min(scoreCh,scoreEn),scoreMa);
    }

    @Override
    public String toString() {
        return "Student{" +
                "no=" + no +
                ", score=" + score +
                ", scoreEn=" + scoreEn +
                ", scoreMa=" + scoreMa +
                ", scoreCh=" + scoreCh +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", max="+ max()+
                ", min="+ min()+
                '}';
    }
}


